﻿@model VehicleManagement.Models.AddGas

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script type="text/javascript">
    $(function () {
        $.post("/Driver/GetDriverNameList", {},
        function (data) {
            $("#Driver_name").empty();
            $.each(data, function () {
                $("#Driver_name").append('<option>' + this + '<option>');
            });
        });

        $.post("/CarInfo/GetCarNumberList", {},
        function (data) {
            $("#Car_num").empty();
            $.each(data, function () {
                $("#Car_num").append('<option>' + this + '<option>');
            });
        });
    });

</script>
<h2>编辑</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>加油信息编辑</legend>

        @Html.HiddenFor(model => model.AddGasID)

                 <div class="editor-label">
                 <span>@Html.LabelFor(model => model.Driver_name):</span>
                @Html.DropDownListFor(model => model.Driver_name, new SelectList(new[] { "司机姓名" }, "司机姓名"))
                @Html.ValidationMessageFor(model => model.Driver_name) 
            </div> 

               <div class="editor-label">
                 <span>@Html.LabelFor(model => model.Car_num):</span>
                @Html.DropDownListFor(model => model.Car_num, new SelectList(new[] { "车牌号" }, "车牌号"))
                @Html.ValidationMessageFor(model => model.Car_num)
            </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gas_Date)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Gas_Date)
            @Html.ValidationMessageFor(model => model.Gas_Date)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.InvoiceNo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.InvoiceNo)
            @Html.ValidationMessageFor(model => model.InvoiceNo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gas_Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Gas_Name)
            @Html.ValidationMessageFor(model => model.Gas_Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gas_Type)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Gas_Type)
            @Html.ValidationMessageFor(model => model.Gas_Type)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Num)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Num)
            @Html.ValidationMessageFor(model => model.Num)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Cost)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Cost)
            @Html.ValidationMessageFor(model => model.Cost)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Approval)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Approval)
            @Html.ValidationMessageFor(model => model.Approval)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Distance)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Distance)
            @Html.ValidationMessageFor(model => model.Distance)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.GasSta_Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GasSta_Name)
            @Html.ValidationMessageFor(model => model.GasSta_Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Remark)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remark)
            @Html.ValidationMessageFor(model => model.Remark)
        </div>

        <p>
            <input type="submit" value="确认" />
            <input type="reset" value="重置" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回列表", "Index")
</div>

